package aoj.no_0000;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class No_0009 {
	public static void main(String[] args) throws IOException {
		InputStreamReader input = new InputStreamReader(System.in);
		BufferedReader reader = new BufferedReader(input);
		
		String line = reader.readLine();
		while(line != null) {	
			int n = Integer.parseInt(line);
			boolean[] isPrime = new boolean[n+1];
			for(int i = 0; i <= n; i++)
				isPrime[i] = true;
			
			isPrime[0] = isPrime[1] = false;
			for(int i = 0; i <= n; i++) {
				if(isPrime[i] == false)
					continue;
				for(int j = 2; j <= n/i; j++) {
					isPrime[i*j] = false;
				}
			}
			int ans = 0;
			for(int i = 0; i <= n; i++)
				if(isPrime[i])
					ans++;
			System.out.println(ans);
			line = reader.readLine();
		}
	}
}
